
#include "MainSplitterWnd.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

IMPLEMENT_DYNCREATE(CMainSplitterWnd, CSplitterWnd)

BEGIN_MESSAGE_MAP(CMainSplitterWnd, CSplitterWnd)
    //{{AFX_MSG_MAP(CMainSplitterWnd)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CMainSplitterWnd::OnDrawSplitter( CDC* pDC, ESplitType nType, const CRect& rectArg )
{
    // if pDC == NULL, then just invalidate
    if (pDC == NULL)
    {
        RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
        return;
    }
    ASSERT_VALID(pDC);

    // otherwise, actually draw
    CRect rect = rectArg;
    switch (nType)
    {
    case splitBorder:
        pDC->Draw3dRect( rect, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE) );
        rect.InflateRect( -1, -1 );
        pDC->Draw3dRect( rect, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE) );
        return;

    case splitBox:
    case splitBar:
            pDC->Draw3dRect(rect, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE) );
            rect.InflateRect(-1, -1);
            pDC->Draw3dRect(rect, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE) );
            rect.InflateRect(-1, -1);
            break;

    default:
        ASSERT(FALSE);  // unknown splitter type
    }

    // fill the middle
    COLORREF clr = ::GetSysColor(COLOR_BTNFACE);
    pDC->FillSolidRect(rect, clr);
}
